using System;
using System.Text;
using System.Globalization;
using System.Collections.Generic;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
using System.IO;
using System.Configuration;
using Microsoft.SharePoint.Utilities;
using System.Reflection;
using System.Collections;
using System.Diagnostics;

namespace CKS.FormsBasedAuthentication
{   
    /// <summary>
    /// This class is a feature activation event handler for the Self Management feature.
    /// </summary>
    class SelfManagementFeatureReceiver : SPFeatureReceiver
    {
        public override void FeatureActivated(SPFeatureReceiverProperties properties) 
        {
            // get site reference
            SPSite site = properties.Feature.Parent as SPSite;

            // update layouts site map
            try
            {
                UpdateLayoutsSitemap uls = new UpdateLayoutsSitemap(site.WebApplication);
                uls.AddSitemap("layouts.sitemap.FBASelfManagement.xml");
                uls.SubmitJob();
            }
            catch (Exception ex)
            {
                Utils.LogError(ex);
            }          
        }        

        public override void FeatureDeactivating(SPFeatureReceiverProperties properties) 
        {           
        }

        public override void FeatureInstalled(SPFeatureReceiverProperties properties)
        {         
        }

        public override void FeatureUninstalling(SPFeatureReceiverProperties properties)
        {         
        }
    }
}